home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 428_02 / examples / pickfile.c < prev    next >
C/C++ Source or Header  |  1994-03-13  |  648b  |  34 lines

  1. /*
  2. ** PICKFILE.C: Lets the user select a file in the current
  3. ** directory.
  4. */
  5.  
  6. #include <stdio.h>
  7. #include <pictor.h>
  8.  
  9. COLORSTRUCT colors = {
  10.    foreback(BOLD+CYAN,BLUE),
  11.    foreback(BOLD+WHITE,CYAN),
  12.    foreback(BLACK,WHITE),
  13.    foreback(BOLD+WHITE,WHITE)
  14. };
  15.  
  16. void main()
  17. {
  18.    char buffer[45];
  19.    char *cptr;
  20.  
  21.    /* initialize the library */
  22.    initvideo();
  23.  
  24.    cptr = pickfile("*.*","Pick a File",&colors);
  25.    if(cptr != NULL) {
  26.       sprintf(buffer,"You selected %s",cptr);
  27.       messagebox(buffer,NULL,MB_OK,&colors);
  28.    }
  29.    else {
  30.       messagebox("You pressed <Escape>",NULL,MB_OK,
  31.          &colors);
  32.    }
  33. }
  34.